@import "~scssbase";

.braft-finder {
  .bf-uploader {
    position: relative;
    height: 370px;
    margin: 0;
    &.draging {
      .bf-list-wrap,
      .bf-add-external {
        pointer-events: none;
      }
    }
    input::-webkit-input-placeholder {
      color: #ccc;
    }
    input::-moz-placeholder {
      color: #ccc;
    }
    input::-ms-input-placeholder {
      color: #ccc;
    }
  }

  .bf-list-wrap {
    position: relative;
    height: 370px;
  }
  .bf-list-tools {
    z-index: 1;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 20px;
    padding: 0 15px;
    background-color: #fff;
    span {
      height: 26px;
      font-size: 12px;
      line-height: 20px;
      cursor: pointer;
      user-select: none;
      &[disabled] {
        opacity: 0.3;
        pointer-events: none;
      }
    }
    .bf-select-all,
    .bf-deselect-all {
      float: left;
      margin-right: 5px;
      color: #bbb;
      &:hover {
        color: $COLOR_ACTIVE;
      }
    }
    .bf-remove-selected {
      float: right;
      color: $COLOR_DANGER;
      &:hover {
        color: $COLOR_DANGER - 30;
      }
    }
  }
  .bf-list {
    position: absolute;
    z-index: 1;
    top: 30px;
    right: 0;
    left: 0;
    bottom: 0;
    margin: 0;
    padding: 0 10px;
    list-style: none;
    overflow: auto;
    &::-webkit-scrollbar {
      width: 5px;
      height: 5px;
      background-color: #fff;
    }
    &::-webkit-scrollbar-track {
      background-color: #fff;
    }
    &::-webkit-scrollbar-thumb {
      background-color: rgba(#000, 0.1);
    }
  }

  .bf-item,
  .bf-add-item {
    position: relative;
    display: block;
    float: left;
    width: 113px;
    height: 113px;
    margin: 5px;
    overflow: hidden;
    border-radius: 3px;
  }

  .bf-item {
    &.uploading {
      pointer-events: none;
    }
    &.error {
      &::before {
        display: block;
        content: "\e901";
      }
      &::after {
        position: absolute;
        z-index: 1;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba($COLOR_DANGER, 0.8);
        content: "";
      }
      &:hover {
        &::after {
          background-color: rgba($COLOR_DANGER, 0.9);
        }
      }
      .bf-item-uploading {
        display: none;
      }
    }
  }

  .bf-add-item {
    background-color: #ecedef;
    color: #999;
    &:hover {
      background-color: #e1e2e3;
    }
    i {
      display: block;
      width: 113px;
      height: 113px;
      font-size: 48px;
      line-height: 113px;
      text-align: center;
    }
    input {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }
  }

  .bf-item {
    &::before {
      display: none;
      position: absolute;
      z-index: 2;
      top: 0;
      left: 0;
      width: 113px;
      height: 113px;
      color: #fff;
      font-size: 48px;
      font-family: "bf-icons";
      line-height: 113px;
      text-align: center;
    }
    &::after {
      position: absolute;
      z-index: 1;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background-color: rgba($COLOR_ACTIVE, 0);
      content: "";
    }
    &:hover {
      &::after {
        background-color: rgba($COLOR_ACTIVE, 0.3);
      }
      .bf-item-remove {
        display: block;
      }
    }
    &.active {
      &::before {
        display: block;
        content: "\e912";
      }
      &::after {
        background-color: rgba($COLOR_ACTIVE, 0.6);
      }
      &:hover {
        &::after {
          background-color: rgba($COLOR_ACTIVE, 0.8);
        }
        .bf-item-remove {
          display: none;
        }
      }
    }
  }

  .bf-item-uploading {
    box-sizing: border-box;
    position: absolute;
    z-index: 3;
    top: 52px;
    left: 10px;
    width: 93px;
    height: 10px;
    overflow: hidden;
    background-color: rgba(#fff, 0.3);
    border-radius: 5px;
    box-shadow: 0 0 0 100px rgba(#000, 0.5);
  }
  .bf-item-uploading-bar {
    height: 10px;
    background-color: $COLOR_ACTIVE;
    border-radius: 0;
  }

  .bf-item-remove {
    display: none;
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    &:hover {
      color: $COLOR_DANGER;
    }
  }

  .bf-item-title {
    display: none;
    box-sizing: border-box;
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    padding: 0 5px;
    overflow: hidden;
    background-image: linear-gradient(rgba(#000, 0), rgba(#000, 1));
    color: #fff;
    font-size: 12px;
    line-height: 55px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bf-image {
    width: 100%;
    height: 100%;
    background-color: #eee;
    user-select: none;
    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
  .bf-video {
    background-color: #8e44ad;
  }
  .bf-audio {
    background-color: #f39c12;
  }
  .bf-embed {
    background-color: #f1c40f;
  }
  .bf-icon {
    display: block;
    width: 113px;
    height: 113px;
    overflow: hidden;
    color: #fff;
    text-align: center;
    text-decoration: none;
    i,
    span {
      display: block;
    }
    i {
      margin-top: 35px;
      font-size: 24px;
    }
    span {
      width: 103px;
      margin: 10px auto;
      overflow: hidden;
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .bf-drag-uploader {
    box-sizing: border-box;
    position: absolute;
    z-index: 2;
    top: 0;
    right: 15px;
    left: 15px;
    height: 100%;
    background-color: #fff;
    border: dashed 1px #bbb;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    &:hover,
    &.draging {
      background-color: #f1f2f3;
    }
    &.active {
      opacity: 1;
      pointer-events: auto;
    }
  }

  .bf-uploader-buttons {
    height: 370px;
    margin: auto;
    text-align: center;
  }

  .bf-drag-tip {
    display: inline-block;
    margin-top: 150px;
    color: #ccc;
    text-align: center;
    font-size: 28px;
    font-weight: normal;
    line-height: 40px;
    input {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      color: #fff;
      text-indent: -100px;
      cursor: pointer;
    }
  }

  .bf-manager-footer {
    height: 36px;
    margin: 10px 0;
    padding: 0 15px;
    .button {
      float: right;
      height: 36px;
      margin-left: 5px;
      padding: 0 35px;
      font-size: 12px;
      font-weight: 700;
      border: none;
      border-radius: 3px;
      cursor: pointer;
    }
    .button-insert {
      color: #fff;
      background-color: $COLOR_ACTIVE;
      &:hover {
        background-color: $COLOR_ACTIVE - 20;
      }
      &[disabled] {
        opacity: 0.3;
        pointer-events: none;
        filter: grayscale(0.4);
      }
    }
    .button-cancel {
      color: #999;
      background-color: #e8e8e9;
      &:hover {
        background-color: #d8d8d9;
      }
    }
  }

  .bf-toggle-external-form {
    color: #666;
    font-size: 12px;
    line-height: 36px;
    span {
      color: #bbb;
      line-height: 16px;
      cursor: pointer;
      user-select: none;
      &:hover {
        color: $COLOR_ACTIVE;
      }
      i {
        position: relative;
        top: 2px;
        font-size: 16px;
      }
    }
  }

  .bf-add-external {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #fff;
    input {
      border: solid 1px rgba(#000, 0.3);
      border: solid 0.5px rgba(#000, 0.3);
      box-shadow: none;
      &:focus {
        border-color: $COLOR_ACTIVE;
        box-shadow: none;
      }
    }
  }

  .bf-external-form {
    width: 500px;
    max-width: 90%;
    margin: 91px auto 0 auto;
  }

  .bf-external-input {
    display: flex;
    position: relative;
    width: 100%;
    height: 40px;
    margin-bottom: 10px;
    div {
      flex: 1;
      height: 40px;
    }
    input,
    textarea {
      display: block;
      box-sizing: border-box;
      width: 100%;
      height: 40px;
      padding: 0 10px;
      border: none;
      border-radius: 3px;
      outline: none;
      box-shadow: inset 0 0 0 1px rgba(#000, 0.3);
      color: #999;
      font-size: 18px;
      &:focus {
        box-shadow: inset 0 0 0 1px $COLOR_ACTIVE;
      }
    }
    textarea {
      height: 100px;
      font-size: 14px;
    }
    button {
      margin-left: 5px;
      padding: 0 15px;
      height: 40px;
      background-color: $COLOR_ACTIVE;
      border: none;
      border-radius: 3px;
      color: #fff;
      font-size: 14px;
      font-weight: bold;
      cursor: pointer;
      &:disabled {
        opacity: 0.3;
        pointer-events: none;
        filter: grayscale(0.4);
      }
      &:hover {
        background-color: $COLOR_ACTIVE - 20;
      }
    }
  }

  .bf-switch-external-type {
    overflow: hidden;
    text-align: center;
    button {
      width: auto;
      height: 30px;
      margin: 10px 5px;
      padding: 0 10px;
      background-color: #e8e9ea;
      border: none;
      border-radius: 3px;
      color: #999;
      font-size: 12px;
      cursor: pointer;
      &:hover {
        background-color: #d8d9da;
      }
      &:only-child {
        display: none;
      }
    }
    &[data-type="IMAGE"] [data-type="IMAGE"],
    &[data-type="VIDEO"] [data-type="VIDEO"],
    &[data-type="AUDIO"] [data-type="AUDIO"],
    &[data-type="EMBED"] [data-type="EMBED"],
    &[data-type="FILE"] [data-type="FILE"] {
      background-color: $COLOR_ACTIVE;
      color: #fff;
    }
  }

  .bf-external-tip {
    display: block;
    margin-top: 15px;
    color: #ccc;
    font-size: 12px;
    text-align: center;
  }
}
